package com.example.service.impl;

import com.example.mapper.Sys_OrderMapper;
import com.example.po.Sys_Order;
import com.example.service.Sys_OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @auter czcjq
 * @date 2022/5/17 15:58
 */
@Service
public class Sys_OrderServiceImpl implements Sys_OrderService {
    @Autowired
    private Sys_OrderMapper sys_orderMapper;

    @Override
    public List<Sys_Order> listAll() {
        List<Sys_Order> orders = sys_orderMapper.listAll();
        return orders;
    }

    @Override
    public List<Sys_Order> listByUid(int uid) {
        List<Sys_Order> list = sys_orderMapper.listByUid(uid);
        return list;
    }

    @Override
    public List<Sys_Order> findOne(int id) {
        List<Sys_Order> one = sys_orderMapper.findOne(id);
        return one;
    }

    @Override
    public Sys_Order addOrder(Sys_Order order) {
        int i = sys_orderMapper.addOrder(order);
        return order;
    }

    @Override
    public boolean delOrder(int id) {
        boolean flag = false;
        int i = sys_orderMapper.delOrder(id);
        if (i > 0) {
            flag = true;
        }

        return flag;
    }
}
